<template>
    <view-box style="background:#F3F6F7;">
      <div style="height:10px;"></div>
      <div class="back-border-pos">
        <x-input class="lof" title="名字：" v-model="addBasic.position" name="school_name" placeholder="请输入名字" ></x-input>
        <p style="width:92%;height:1px;margin-left:4%;background:#E6E6E6"></p>
        <x-input title="座右铭：" class="lof" v-model="addBasic.motto" name="school_name" placeholder="请输入座右铭" ></x-input>
       
      </div>
       <div style="height:20px;"></div>
      <div class="back-border-pos">
        <div class="xb-evali" >
              <p style="margin-left:12px;color:#C0C2C3;">性别:</p>
                <label>
              <input type="radio" v-model="addBasic.sex" name="radio" checked value="1">
              <span></span>
              男生
              </label>
              <p>&nbsp;<i slot="icon" style="color:#008AFF" class="icon-baina_nan iconfont"></i></p>
                <label>
              <input type="radio" v-model="addBasic.sex" name="radio" value="2">
              <span></span>
                  女生
              </label>
              <p>&nbsp;<i slot="icon" style="color:#FF6464;" class="icon-baina_nv iconfont"></i></p>
        </div>
      </div>
      <!-- <div style="height:20px;"></div>
      <div class="back-border-pos">
        <x-input title="年龄：" class="lof" v-model="addBasic.motto" name="school_name" placeholder="请输入座右铭" ></x-input>
      </div> -->
      <!-- <div style="height:20px;"></div>
      <div class="back-border-pos">
        <x-input title="学历：" class="lof" v-model="addBasic.motto" name="school_name" placeholder="请输入座右铭" ></x-input>
      </div> -->
      <!-- <div style="height:20px;"></div>
      <div class="back-border-pos">
        <x-input title="工作年限：" class="lof" v-model="addBasic.motto" name="school_name" placeholder="请输入座右铭" ></x-input>
      </div> -->
      <!-- <div style="height:20px;"></div>
      <div class="back-border-pos">
        <x-input title="现居地：" class="lof" v-model="addBasic.motto" name="school_name" placeholder="请输入座右铭" ></x-input>
      </div> -->
      <!-- <div style="height:20px;"></div>
      <div class="back-border-pos">
          <x-input class="lof" title="姓名：" v-model="addBasic.motto" name="school_name" placeholder="请输入座右铭" ></x-input>
      </div> -->
        <group style="width:92%;margin-left:4%;">
            <x-button style="background:#32B6C6;color:#fff;border:1px solid #32B6C6" @click.native="updata()">保存</x-button>
        </group>
    </view-box>
</template>
<script>
import { ViewBox, Box, XInput, Group, XButton, Datetime, PopupPicker, CheckIcon } from 'vux'
export default {
  name: 'Addresume',
  components: {
    ViewBox,
    Box,
    XInput,
    Group,
    XButton,
    Datetime,
    PopupPicker,
    CheckIcon
  },
  data () {
    return {
      radio001: ['是否统招'],
      value4: '',
      value3: '',
      is_unified: false,
      pid: '',
      addBasic: {
        motto: '',
        position: '',
        sex: 1
      },
      addiss: {},
      data: [],
      addpid: '',
      addResume: {}
    }
  },
  computed: {
    disabled () {
      console.log('zunhh')
    },
    userInfo () {
      return this.$store.getters.userInfo
    }
  },
  mounted () {
    this._getconm()
    this._getresume()
    if (!this.$store.state.auth.userInfo) {
      this.$store.dispatch('getUserInfo')
    }
  },
  methods: {
    change () {
      console.log('zhou')
    },
    _getresume () {
      this.$http.post('/entrance').then(response => {
        this.addBasic = response.data.data
        console.log(this.addBasic)
      }).catch(error => {
        console.log(error)
      })
    },
    updata () {
      let data = {
        motto: this.addBasic.motto,
        position: this.addBasic.position,
        sex: this.addBasic.sex
      }
      this.$http.put('/entrance/up', data).then(response => {
        this.$vux.toast.show({
          text: response.data.message,
          type: 'text'
        })
        this.$router.push({ path: '/myPage' })
        console.log(response)
      }).catch(error => {
        console.log(error)
      })
    },
    _getconm () {
      this.$http.post('/entrance').then(response => {
        this.pid = response.data.data
      })
    }
  }
}
</script>

<style scoped>
    .btn-set-default {
        flex: 1;
        line-height: 50px;
    }
.xb-evali{
width:100%;
background: #fff;
height: 50px;
border-radius: 8px;
line-height: 50px !important;
display: flex;
align-items: center;
color: #bababa;font-size: 14px;
}
.xb-evali input[type="radio"]{display:none;}
.xb-evali input[type="radio"] + span{border:1px solid #CCCCCC;border-radius:20px;width:20px; height:20px; float:left; margin-top:0px;margin-right:10px;margin-left: 10px;}
.xb-evali input[type="radio"]:checked + span{border:1px solid #008AFF;border-radius:20px;background:url(./images/yi.png) no-repeat;background-size: 20px 20px;}
label{display: inline-block;line-height: normal}
.back-border-pos{
  background:#fff;
  width: 92%;
  margin-left: 4%;
  border-radius: 7px;
}
</style>
<style>
 .weui-cells:before{
        border-top: 0px solid #D9D9D9 !important;
    }
    .weui-cells:after{
        border-bottom: 0px solid #D9D9D9 !important;
    }
.lof .weui-label {
    display: block;
    width: 105px;
    word-wrap: break-word;
    word-break: break-all;
    color: #C0C2C3;
  }
  .weui-cell:before {
    border-top: 0px solid #D9D9D9!important;
}
</style>